package com.fandy.struts.SqlStatement;

public class Message {
 

	public   String getMessageByID(int ID)
	{
		return  "select * from Message where " +com.fandy.struts.Meta.Message.getMessageid()+"="+ID;
	}

	public String Add(com.fandy.struts.Model.Message m)
	{
		
		return "insert into GoodsInfo values ("
		+ "'" + m.getDetail()+"',"		 
		+ "'" +m.getState()+"',"
		+ "'"  + m.getTow() + "',"
		+ "'"  + m.getWfrom() + "',"
		+ "'"  + m.getTime() + "',"		
		+")"
		;
		
	}
	
	public   String getAllMyMessages(int UserID)
	{
		return  "select * from Message where " +com.fandy.struts.Meta.Message.getTow()+"='"+UserID+"'";
	}

	public   String getAllMessagesSended(int UserID)
	{
		return  "select * from Message where " +com.fandy.struts.Meta.Message.getWfrom()+"='"+UserID+"'";
	}
	
		
//	public String UpdateByID(int id,com.fandy.struts.Model.Message s)
//	{
//		
//		return "update GoodsInfo set "+com.fandy.struts.Meta.Message.getDetail()
//		+"='" + s.getDetail()+"',"		 
//		+com.fandy.struts.Meta.Message.get+"='" +s.getAuthority()+"',"
//		+com.fandy.struts.Meta.Message.getContact()+ "='"  + s.getContact() + "',"
//		+com.fandy.struts.Meta.Message.getDepartmentid()+ "='"  + s.getDepartmentid() + "',"
//		+com.fandy.struts.Meta.Message.getName() + "='"  + s.getName() + "',"
//		+com.fandy.struts.Meta.Message.getPassword() + "='"  + s.getPassword() + "',"
//		+com.fandy.struts.Meta.Message.getSalary() + "='"  + s.getSalary()+ "'"		
//		+"where "+com.fandy.struts.Meta.Message.getMessageid()+"="+id;
//		
//	}
	
	public String DeleteByID(int id)
	{
		
		return "delete from Message where " + com.fandy.struts.Meta.Message.getMessageid() +"="+id;
		
	}
	
	
	
}

